﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Views/Shared/Site.Master" Inherits="System.Web.Mvc.ViewPage<CodeCamp.BL.Session>" %>

<asp:Content ID="Content1" ContentPlaceHolderID="TitleContent" runat="server">
	Add
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">
	<h2>
		Add</h2>
	<% using (Html.BeginForm())
	{%>
	<fieldset>
		<legend>Fields</legend>
		<div class="editor-label">
			<%= Html.LabelFor(model => model.Name) %>
		</div>
		<div class="editor-field">
			<%= Html.TextBoxFor(model => model.Name) %>
			<%= Html.ValidationMessageFor(model => model.Name) %>
		</div>
		<div class="editor-label">
			<%= Html.LabelFor(model => model.Excerpt) %>
		</div>
		<div class="editor-field">
			<%= Html.TextAreaFor(model => model.Excerpt,6,64,null) %>
			<%= Html.ValidationMessageFor(model => model.Excerpt) %>
		</div>
		<div class="editor-label">
			<%= Html.LabelFor(model => model.Description) %>
		</div>
		<div class="editor-field">
			<%= Html.TextAreaFor(model => model.Description,8,64,null) %>
			<%= Html.ValidationMessageFor(model => model.Description) %>
		</div>
		<div class="editor-label">
			<%= Html.LabelFor(model => model.SegmentCount) %>
		</div>
		<div class="editor-field">
			<% Html.RenderPartial("SessionSegmentCount"); %>
		</div>
		<div class="editor-label">
			<%= Html.LabelFor(model => model.Tags) %>
		</div>
		<div class="editor-field">
			<%= Html.TextBox("tagList", string.Join(",",Model.Tags.Select(t=> t.Name ).ToArray())) %>
		</div>
		<p>
			<input type="submit" value="Add Session" />
		</p>
	</fieldset>
	<% } %>
	<div>
		<%=Html.ActionLink("Back to List", "Index") %>
	</div>
</asp:Content>
